<!DOCTYPE html>
<html lang="zxx">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <title>FoodKa - Food Ordering, Delivery & Restuarent Template</title>

    <!-- Stylesheet -->
    <link rel="stylesheet" href="static/css/animate.min.css">
    <link rel="stylesheet" href="static/css/bootstrap.min.css">
    <link rel="stylesheet" href="static/css/magnific.min.css">
    <link rel="stylesheet" href="static/css/nice-select.min.css">
    <link rel="stylesheet" href="static/css/jquery-ui.min.css">
    <link rel="stylesheet" href="static/css/owl.min.css">
    <link rel="stylesheet" href="static/css/slick-slide.min.css">
    <link rel="stylesheet" href="static/css/fontawesome.min.css">
    <link rel="stylesheet" href="static/css/remixicon.css">
    <link rel="stylesheet" href="static/css/style.css">
    <link rel="stylesheet" href="static/css/responsive.css">
    <script src="static/js/jquery.3.6.min.js"></script>
    <!--Google Fonts-->
    <link href="static/css/css2.css" rel="stylesheet">


<script>
    $(function() {
        findOne();
    })
    function findOne() {
        $.post("/Pizza_war_exploded/User/findOne",
            {},
            function (data) {
            if (data.flag){
                load(1);
            }else {
                alert("请先登陆！")
                location.href = "/Pizza_war_exploded/login.html";
            }
            }, "json");
    }
    function load(currentPage){
        $.post("/Pizza_war_exploded/Order/FindOrdersByCurrentPage",
            {currentPage:currentPage},
            function (data){
            var liList = '';
            for (var i = 0; i < data.list.length; i++){
                var foodName = '';
                $MyDiv = $("#MyOrders");
                for (var j=0;j < data.list[i].orderInfo.length ; j++){
                    if (j>0){
                        foodName += '&';
                    }
                    foodName += data.list[i].orderInfo[j].food.fname;
                }
                var div = '<div class="col-sm-6">\n' +
                    '                            <div class="single-blog-wrap">\n' +
                    '                                <div class="thumb">\n' +
                    '                                    <img src="'+data.list[i].orderInfo[0].food.food_img.pic+'" alt="img">\n' +
                    '                                </div>\n' +
                    '                                <div class="wrap-details">\n' +
                    '                                    <span class="cat">\n' +
                    '                                        <span class="date">\n' +
                    '                                            <i class="ri-calendar-todo-fill"></i>'+data.list[i].date+
                    '                                        </span>\n' +
                    '                                        <a href="#" class="tag me-0">\n' +
                    '                                            <i class="ri-price-tag-3-fill"></i>'+data.list[i].address+
                    '                                        </a>\n' +
                    '                                    </span>\n' +
                    '                                    <h5><a href="blog-details.html?oid='+data.list[i].oid+'">收货人 : '+data.list[i].name+'</a></h5>\n' +
                    '                                    <div style="width: 300px;height: 200px" class="wrap-hover-area">\n' +
                    '                                        <p > '+foodName+'\n' +
                    '                                        </p>\n' +
                    '                                        <p> 订单总价 : '+data.list[i].total_price+'\n' +
                    '                                        </p>\n'+
                    '                                        <a class="link-btn" href="blog-details.html?oid='+data.list[i].oid+'">详情</a>\n' +
                    '                                    </div>\n' +
                    '                                </div>\n' +
                    '                            </div>\n' +
                    '                        </div>';
                liList += div;
            }
            $MyDiv.html(liList);

                // 拼接页码 前5后4
                var start = data.currentPage - 5;
                var end = data.currentPage + 4;
                if (start < 1) { // 前面不足5个
                    start = 1;
                    end = 10;
                }
                if (end > data.totalPage) { // 后面不足4个
                    end = data.totalPage;
                    start = end - 9;
                }
                if (data.totalPage < 10) { // 总页数不足10个
                    start = 1;
                    end = data.totalPage;
                }
                /*
                            <li class="page-item">
                            <a class="page-link" href="#">
                                <i class="ri-arrow-left-s-line"></i>
                            </a>
                            </li>
                            <li class="page-item active"><a class="page-link" href="#">1</a></li>
                            <li class="page-item"><a class="page-link" href="#">2</a></li>
                            <li class="page-item"><a class="page-link" href="#">3</a></li>
                            <li class="page-item">
                            <a class="page-link" href="#">
                                <i class="ri-arrow-right-s-line"></i>
                            </a>
                            </li>
                */
                $pageUl = $("#pageUl");

                // 上一页
                // 上一页
                var prePage = data.currentPage - 1;
                if (prePage < 1) {
                    prePage = 1;
                }
                var pageList = '<li class="page-item">\n' +
                    '                            <a class="page-link" href="javascript:load('+prePage+')">\n' +
                    '                                <i class="ri-arrow-left-s-line"></i>\n' +
                    '                            </a>\n' +
                    '                            </li>';

                // 页码
                for (var i = start; i <= end; i++) {
                    if (i == data.currentPage) {
                        pageList += '<li onclick="load('+i+')" class="page-item active"><a class="page-link" href="javascript:">'+i+'</a></li>';
                    } else {
                        pageList += '<li onclick="load('+i+')" class="page-item"><a class="page-link" href="javascript:">'+i+'</a></li>';
                    }
                }
                // 下一页
                var nextPage = data.currentPage + 1;
                if (nextPage > data.totalPage) {
                    nextPage = data.totalPage;
                }
                pageList +='<li class="page-item">\n' +
                    '                    <a class="page-link" href="javascript:load('+nextPage+')">\n' +
                    '                        <i class="ri-arrow-right-s-line"></i>\n' +
                    '                    </a>\n' +
                    '                </li>';
                $pageUl.html(pageList);
                /*
                                <li>
                                    <div class="media">
                                        <div class="media-left">
                                            <img src="static/picture/13.png" alt="widget">
                                        </div>
                                        <div class="media-body">
                                            <h6 class="title"><a href="#">Greek yogurt breakfast bowls with toppings</a></h6>
                                        </div>
                                    </div>
                                </li>
                */
                $NoneGetOrder = $("#NoneGetOrder");
                $.post("/Pizza_war_exploded/Order/GetNoneGetOrder",{},
                    function (data){
                    var liList = '';
                    if (!data.length>0){
                        liList = '<li><div class="media-body"><h6 class="title">暂无信息</h6></div></li>';
                    }else {
                        for (var i = 0; i < data.length; i++) {
                            var foodName = '';
                            for (var j = 0; j < data[i].orderInfo.length; j++) {
                                if (j > 0) {
                                    foodName += '&';
                                }
                                foodName += data[i].orderInfo[j].food.fname;
                            }
                            var li = '<li>\n' +
                                '                                    <div class="media">\n' +
                                '                                        <div class="media-left">\n' +
                                '                                            <img src="' + data[i].orderInfo[0].food.food_img.pic + '" alt="widget" width="75px">\n' +
                                '                                        </div>\n' +
                                '                                        <div class="media-body">\n' +
                                '                                            <h6 class="title"><a href="#">' + foodName + '</a></h6>\n' +
                                '                                            <a class="link-btn" href="blog-details.html?oid='+data[i].oid+'">详情</a>'+
                                '                                        </div>\n' +
                                '                                    </div>\n' +
                                '                                </li>';
                            liList += li;
                        }
                    }
                    $NoneGetOrder.html(liList);
                },"json")
        },"json")
    }
</script>
</head>
<body class='sc5'>
    <!-- preloader area start -->
    <div class="preloader" id="preloader">
        <div class="preloader-inner">
            <div id="wave1">
            </div>
            <div class="spinner">
                <div class="dot1"></div>
                <div class="dot2"></div>
            </div>
        </div>
    </div>
    <!-- preloader area end -->
    <!-- search popup area start -->
    <div class="body-overlay" id="body-overlay"></div>
    <div class="td-search-popup" id="td-search-popup">
<!--
        <form action="index.html" class="search-form">
            <div class="form-group">
                <input type="text" class="form-control" placeholder="Search.....">
            </div>
            <button type="submit" class="submit-btn"><i class="fa fa-search"></i></button>
        </form>
-->
    </div>
    <!-- //. search Popup -->

    <!-- navbar start -->
    <div id="header"></div>
    <!-- navbar end -->

    <!-- bredcrumb Area Start-->
    <section class="breadcrumb-area">
        <div class="banner-bg-img"></div>
        <div class="banner-shape-1"><img src="static/picture/shape-1.png" alt="img"></div>
        <div class="banner-shape-2"><img src="static/picture/shape-2.png" alt="img"></div>
        <div class="container">
            <div class="row justify-content-center">
                <div class="col-lg-6 align-self-center">
                    <div class="banner-inner text-center">
                        <h3>order
                        </h3>
                        <h1>Historical order</h1>
                        <nav aria-label="breadcrumb">
                            <ul class="breadcrumb">
                              <li class="breadcrumb-item"><a href="index.html">Home</a></li>
                              <li class="breadcrumb-item active" aria-current="page">Historical order</li>
                            </ul>
                        </nav>
                    </div>
                </div>
            </div>
        </div>
    </section>
    <!-- bredcrumb Area End --> 

    <!-- blog Area Start-->
    <section class="blog-area pd-top-120 pd-bottom-120">
        <div class="container">
            <div class="row justify-content-center">
                <div class="col-lg-8">
                    <div id="MyOrders" class="row justify-content-center">
                        <!--<div class="col-sm-6">
                            <div class="single-blog-wrap">
                                <div class="thumb">
                                    <img src="static/picture/11.png" alt="img">
                                </div>
                                <div class="wrap-details">
                                    <span class="cat">
                                        <span class="date">
                                            <i class="ri-calendar-todo-fill"></i>July 14, 2021
                                        </span>
                                        <a href="#" class="tag me-0">
                                            <i class="ri-price-tag-3-fill"></i>Burgar
                                        </a>
                                    </span>
                                    <h5><a href="blog-details.html">Greek yogurt breakfast bowls with toppings</a></h5>
                                    <div class="wrap-hover-area">
                                        <p> It with just a touch of sauce. saucy riff, more in the style of takeout American Chinese kung pao. The sauce makes it perfect for eating with rice.
                                        </p>
                                        <a class="link-btn" href="blog-details.html">Read More</a>
                                    </div>
                                </div>
                            </div>
                        </div>
                        <div class="col-sm-6">
                            <div class="single-blog-wrap">
                                <div class="thumb">
                                    <img src="static/picture/21.png" alt="img">
                                </div>
                                <div class="wrap-details">
                                    <span class="cat">
                                        <span class="date">
                                            <i class="ri-calendar-todo-fill"></i>July 05, 2021
                                        </span>
                                        <a href="#" class="tag me-0">
                                            <i class="ri-price-tag-3-fill"></i>Pizza
                                        </a>
                                    </span>
                                    <h5><a href="blog-details.html">Broad beans, tomato, garlic & mozzarella bruschetta
                                    </a></h5>
                                    <div class="wrap-hover-area">
                                        <p> It with just a touch of sauce. saucy riff, more in the style of takeout American Chinese kung pao. The sauce makes it perfect for eating with rice.
                                        </p>
                                        <a class="link-btn" href="blog-details.html">Read More</a>
                                    </div>
                                </div>
                            </div>
                        </div>
                        <div class="col-sm-6">
                            <div class="single-blog-wrap">
                                <div class="thumb">
                                    <img src="static/picture/31.png" alt="img">
                                </div>
                                <div class="wrap-details">
                                    <span class="cat">
                                        <span class="date">
                                            <i class="ri-calendar-todo-fill"></i>August 14, 2021
                                        </span>
                                        <a href="#" class="tag me-0">
                                            <i class="ri-price-tag-3-fill"></i>Pizza
                                        </a>
                                    </span>
                                    <h5><a href="blog-details.html">Make authentic Italian margherita pizza at home
                                    </a></h5>
                                    <div class="wrap-hover-area">
                                        <p> It with just a touch of sauce. saucy riff, more in the style of takeout American Chinese kung pao. The sauce makes it perfect for eating with rice.
                                        </p>
                                        <a class="link-btn" href="blog-details.html">Read More</a>
                                    </div>
                                </div>
                            </div>
                        </div>
                        <div class="col-sm-6">
                            <div class="single-blog-wrap">
                                <div class="thumb">
                                    <img src="static/picture/42.png" alt="img">
                                </div>
                                <div class="wrap-details">
                                    <span class="cat">
                                        <span class="date">
                                            <i class="ri-calendar-todo-fill"></i>June 12, 2021
                                        </span>
                                        <a href="#" class="tag me-0">
                                            <i class="ri-price-tag-3-fill"></i>Fresh food
                                        </a>
                                    </span>
                                    <h5><a href="blog-details.html">We Have Excellent Of Quality Japanese Food
                                    </a></h5>
                                    <div class="wrap-hover-area">
                                        <p> It with just a touch of sauce. saucy riff, more in the style of takeout American Chinese kung pao. The sauce makes it perfect for eating with rice.
                                        </p>
                                        <a class="link-btn" href="blog-details.html">Read More</a>
                                    </div>
                                </div>
                            </div>
                        </div>
                        <div class="col-sm-6">
                            <div class="single-blog-wrap">
                                <div class="thumb">
                                    <img src="static/picture/51.png" alt="img">
                                </div>
                                <div class="wrap-details">
                                    <span class="cat">
                                        <span class="date">
                                            <i class="ri-calendar-todo-fill"></i>June 5, 2021
                                        </span>
                                        <a href="#" class="tag me-0">
                                            <i class="ri-price-tag-3-fill"></i>Fresh food
                                        </a>
                                    </span>
                                    <h5><a href="blog-details.html">Different spice for a Different cheese bruschetta

                                    </a></h5>
                                    <div class="wrap-hover-area">
                                        <p> It with just a touch of sauce. saucy riff, more in the style of takeout American Chinese kung pao. The sauce makes it perfect for eating with rice.
                                        </p>
                                        <a class="link-btn" href="blog-details.html">Read More</a>
                                    </div>
                                </div>
                            </div>
                        </div>-->
                        <!--<div class="col-sm-6">
                            <div class="single-blog-wrap">
                                <div class="thumb">
                                    <img src="static/picture/61.png" alt="img">
                                </div>
                                <div class="wrap-details">
                                    <span class="cat">
                                        <span class="date">
                                            <i class="ri-calendar-todo-fill"></i>September 10, 2021
                                        </span>
                                        <a href="#" class="tag me-0">
                                            <i class="ri-price-tag-3-fill"></i>Spicy
                                        </a>
                                    </span>
                                    <h5><a href="blog-details.html">Celebrating the awesomeness of food.
                                    </a></h5>
                                    <div class="wrap-hover-area">
                                        <p> It with just a touch of sauce. saucy riff, more in the style of takeout American Chinese kung pao. The sauce makes it perfect for eating with rice.
                                        </p>
                                        <a class="link-btn" href="blog-details.html">Read More</a>
                                    </div>
                                </div> 
                            </div>
                        </div>-->
                    </div>
                </div>
                <div class="col-lg-4">
                    <div class="sidebar-area">
<!--                        <div class="widget widget_search">-->
<!--                            <form class="search-form">-->
<!--                                <div class="form-group">-->
<!--                                    <input type="text" placeholder="Search your itmes">-->
<!--                                </div>-->
<!--                                <button class="submit-btn" type="submit"><i class="ri-search-line"></i></button>-->
<!--                            </form>-->
<!--                        </div>-->
                        <div class="widget widget-recent-post">
                            <h4 class="widget-title">等待送达</h4>
                            <ul id="NoneGetOrder">
                                <!--<li>
                                    <div class="media">
                                        <div class="media-left">
                                            <img src="static/picture/13.png" alt="widget">
                                        </div>
                                        <div class="media-body">
                                            <h6 class="title"><a href="#">Greek yogurt breakfast bowls with toppings</a></h6>
                                        </div>
                                    </div>
                                </li>
                                <li>
                                    <div class="media">
                                        <div class="media-left">
                                            <img src="static/picture/23.png" alt="widget">
                                        </div>
                                        <div class="media-body">
                                            <h6 class="title"><a href="#">Broad, garlic & mozzarella cheese bruschetta
                                            </a></h6>
                                        </div>
                                    </div>
                                </li>
                                <li>
                                    <div class="media">
                                        <div class="media-left">
                                            <img src="static/picture/33.png" alt="widget">
                                        </div>
                                        <div class="media-body">
                                            <h6 class="title"><a href="#">Make authentic Italian margherita pizza at home
                                            </a></h6>
                                        </div>
                                    </div>
                                </li>
                                <li>
                                    <div class="media">
                                        <div class="media-left">
                                            <img src="static/picture/43.png" alt="widget">
                                        </div>
                                        <div class="media-body">
                                            <h6 class="title"><a href="#">BBQ Chicken Classic Pizza Large</a></h6>
                                        </div>
                                    </div>
                                </li>-->
                            </ul>
                        </div>
<!--                        <div class="widget widget-newsletter">-->
<!--                            <h4 class="widget-title">Newsletter</h4>-->
<!--                            <p>Subscribe to get the latest news, update and offer information. Don't worry, we won't send spam!</p>-->
<!--                            <form class="newsletter-form">-->
<!--                                <div class="form-group">-->
<!--                                    <input type="email" placeholder="Enter e-mail">-->
<!--                                </div>-->
<!--                                <button class="submit-btn" type="submit"><i class="ri-arrow-right-line"></i></button>-->
<!--                            </form>-->
<!--                        </div>-->
<!--                        <div class="widget widget_categories">-->
<!--                            <h4 class="widget-title">Categories</h4>-->
<!--                            <ul>-->
<!--                                <li><a href="#">Inspiration <span>(5)</span></a></li>-->
<!--                                <li><a href="#">Recipes <span>(9)</span> </a></li>-->
<!--                                <li><a href="#">Others <span>(18)</span></a></li>-->
<!--                            </ul>-->
<!--                        </div>-->
                    </div>
                </div>
                <div class="col-12">
                    <nav>
                        <ul id="pageUl" class="pagination">
                            <li class="page-item">
                            <a class="page-link" href="#">
                                <i class="ri-arrow-left-s-line"></i>
                            </a>
                            </li>
                            <li class="page-item active"><a class="page-link" href="#">1</a></li>
                            <li class="page-item"><a class="page-link" href="#">2</a></li>
                            <li class="page-item"><a class="page-link" href="#">3</a></li>
                            <li class="page-item">
                            <a class="page-link" href="#">
                                <i class="ri-arrow-right-s-line"></i>
                            </a>
                            </li>
                        </ul>
                    </nav>
                </div>
            </div>
        </div>
    </section>
    <!-- blog Area End -->

    <!-- footer area start -->
    <div id="footer"></div>
    <!-- footer area end -->    

    <!-- back-to-top end -->
    <div class="back-to-top">
        <span class="back-top"><i class="fas fa-angle-double-up"></i></span>
    </div>

    

    <!-- all plugins here -->

    <script src="static/js/jquery-ui.min.js"></script>
    <script src="static/js/bootstrap.min.js"></script>
    <script src="static/js/imageloded.min.js"></script>
    <script src="static/js/counterup.js"></script>
    <script src="static/js/waypoint.js"></script>
    <script src="static/js/magnific.min.js"></script>
    <script src="static/js/isotope.pkgd.min.js"></script>
    <script src="static/js/nice-select.min.js"></script>
    <script src="static/js/fontawesome.min.js"></script>
    <script src="static/js/owl.min.js"></script>
    <script src="static/js/slick-slider.min.js"></script>
    <script src="static/js/wow.min.js"></script>
    <script src="static/js/tweenmax.min.js"></script>
    <!-- main js  -->
    <script src="static/js/main.js"></script>
    <script type="text/javascript" src="static/js/include.js"></script>
</body>
</html>